Skip to content

Implement LWG-4293: span::subspan/first/last chooses wrong constructor when T is const-qualified bool - #6437

Merged
Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
tycket033-tech:issue-6239-lwg-4293-span-subspan
Oct 1, 2026
Merged

Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:mainfrom
tycket033-tech:issue-6239-lwg-4293-span-subspan

Conversation

@tycket033-tech

Copy link
Copy Markdown
Contributor

Fixes #6239

LWG-4293 changes the Effects of span::first/last/subspan to
direct-initialize the returned span ((ptr, count)) instead of brace-initializing,
so an initializer_list constructor can never hijack these calls.

Since P2447R6 was reverted and MSVC STL never implemented it anyway, this has
zero functional impact — just a wording-sync per "Do What The Standard Says".

Copilot AI balanced review requested due to automatic review settings September 4, 2026 18:34
@tycket033-tech
zika (tycket033-tech) requested a review from a team as a code owner September 4, 2026 18:34
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Sep 4, 2026
@azure-pipelines

This comment was marked as resolved.

This comment was marked as resolved.

Comment thread stl/inc/span Resolved
Comment thread tests/std/tests/P0122R7_span/test.cpp Resolved
Copilot AI review requested due to automatic review settings September 5, 2026 08:07

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings September 24, 2026 22:01

This comment was marked as resolved.

@tycket033-tech

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@StephanTLavavej

Copy link
Copy Markdown
Member

If CI fails in the future (it's unclear why the ARM64 build failed; no reason seems to be logged and I haven't seen this happen before), you can comment in the #stalled-checks channel in the STL Discord to get my attention so I can rerun just what failed, as opposed to pushing a whole commit that will rerun everything.

@tycket033-tech

Copy link
Copy Markdown
Contributor Author

If CI fails in the future (it's unclear why the ARM64 build failed; no reason seems to be logged and I haven't seen this happen before), you can comment in the #stalled-checks channel in the STL Discord to get my attention so I can rerun just what failed, as opposed to pushing a whole commit that will rerun everything.

Thanks for the tip! I'll use the #stalled-checks channel next time instead of pushing an extra commit.

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo. Please notify me if any further changes are pushed, otherwise no action is required.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit f7e4bdb into microsoft:main Oct 1, 2026
48 checks passed
@StephanTLavavej

Copy link
Copy Markdown
Member

😻 🚀 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

LWG-4293 span::subspan/first/last chooses wrong constructor when T is const-qualified bool

4 participants